classdef TestCon < handle
    %TestCon Shows Constructor, Destructor example
    %   Detailed explanation goes here
    
    properties
        X
    end
    
    methods
        function obj=TestCon()  %must output 'obj'
            %'obj' is NOT the first input in this special case
            %We could take other input arguments (not shown)
            fprintf('constructing object\n')
            obj.X=4;  %we could set properties, etc
        end
        
        function delete(obj)    %this code is run when the variable is cleared or deleted
            fprintf('deleting object\n')
        end

    end
    
end

